#include "SystemVshm.hpp"

//创建和写端

int main()
{
    // key_t key = GetKey(); //获取key
    // // cout<<"0x"<<hex<<key<<endl;
    // int shmid = CreateShm(key,fsize);  //创建共享内存
    // //cout<<shmid<<endl;

    // char* s = (char*)AttackShm(shmid);

    SHM<char> s(WRITE);

    char str[1024] = {0};
    int i = 0;
    while(true)
    {
        fgets(s(),sizeof(str),stdin);
        s()[strlen(s()) - 1] = 0;
        //str[strlen(str)] = 0;
        //snprintf(s(),sizeof(str),"%s",str);
        if(strcasecmp(s(),"quit") == 0) break;
        
    }

    //解除链接
    //DetachShm(s);

    //删除共享内存
    //DelShm(shmid);

    return 0;
}